package com.tbit.uqbike.client.pojo.newEntity;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.Date;

/**
 * @Author: chen
 * @Description: 摄像头网关回复对象
 * @Date: 创建于 17:22 2021/7/7
 */
public class WebcamInfo {
    /**
     * 时间
     */
    private Date dt;
    /**
     * 结果
     */
    private Integer ret;
    /**
     * 扩展数据类型(0x00 默认类型 0x01 新版摄像头应答指令)
     */
    private Integer extendType;
    /**
     * 摄像头版本号
     */
    private String cameraVersion;
    /***/
    private Integer cameraErrorCode;
    /**
     * 识别相似度
     */
    private Integer similar;
    /**
     * 图片识别角度 未识别返回255
     */
    private Long picDir;

    public static void main(String[] args) {

        String tmp = "{\"feedback\":\"\",\"data\":{\"paramRet\":\"{\\\"cameraErrorCode\\\":15,\\\"cameraVersion\\\":\\\"00000065\\\",\\\"extendType\\\":1,\\\"picDir\\\":255,\\\"ret\\\":7,\\\"serNo\\\":46,\\\"serNoStr\\\":\\\"87cc3f43-1890-41cf-a98c-2941bd1b1773\\\",\\\"similar\\\":0}\",\"serNO\":\"87cc3f43-1890-41cf-a98c-2941bd1b1773\"},\"msgId\":30001}";
        JSONObject jsonObject = JSON.parseObject(tmp);
        JSONObject jsonObject1 = jsonObject.getJSONObject("data");
        System.out.println(jsonObject1);
        WebcamInfo webcamInfo = JSON.parseObject(jsonObject1.getString("paramRet"), WebcamInfo.class);
        System.out.println(webcamInfo);
    }

    public Date getDt() {
        return dt;
    }

    public void setDt(Date dt) {
        this.dt = dt;
    }

    public Integer getRet() {
        return ret;
    }

    public void setRet(Integer ret) {
        this.ret = ret;
    }

    public Integer getExtendType() {
        return extendType;
    }

    public void setExtendType(Integer extendType) {
        this.extendType = extendType;
    }

    public String getCameraVersion() {
        return cameraVersion;
    }

    public void setCameraVersion(String cameraVersion) {
        this.cameraVersion = cameraVersion;
    }

    public Integer getCameraErrorCode() {
        return cameraErrorCode;
    }

    public void setCameraErrorCode(Integer cameraErrorCode) {
        this.cameraErrorCode = cameraErrorCode;
    }

    public Integer getSimilar() {
        return similar;
    }

    public void setSimilar(Integer similar) {
        this.similar = similar;
    }

    public Long getPicDir() {
        return picDir;
    }

    public void setPicDir(Long picDir) {
        this.picDir = picDir;
    }

    @Override
    public String toString() {
        return "WebcamInfo{" +
                "dt=" + dt +
                ", ret=" + ret +
                ", extendType=" + extendType +
                ", cameraVersion='" + cameraVersion + '\'' +
                ", cameraErrorCode=" + cameraErrorCode +
                ", similar=" + similar +
                ", picDir=" + picDir +
                '}';
    }
}
